home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / smake155.zip / SMAKE.DOC < prev    next >
Text File  |  1993-06-15  |  9KB  |  230 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                            ADEPT COMPUTER CONSULTANTS
  8.  
  9.                                     PRESENTS
  10.  
  11.                                ------------------
  12.                                --- SMART MAKE ---
  13.                                -- VERSION 1.55 --
  14.                                ------------------
  15.  
  16.          OVERVIEW
  17.  
  18.  
  19.          SMARTMAKE is a  software  system  consisting  of  two  files.
  20.          SMAKE.BAT and SMAKEMCM.EXE.    The   batch  file  prepares  a
  21.          directory listing and  the  executable  then  processes  that
  22.          listing to determine which files need to be recompiled.
  23.  
  24.  
  25.          Who should use SMARTMAKE?  Anyone that programs in a language
  26.          that can be  operated  from the command line can benefit from
  27.          SMARTMAKE.  The programmers that  will  gain the most are the
  28.          ones who work with large software systems, consisting of many
  29.          source files.
  30.  
  31.  
  32.          How do you use SMARTMAKE?  This program requires  the user to
  33.          create two supplemental  files  for each software system that
  34.          he works with.  These files should  reside  in  the directory
  35.          with the source files.  The files are generally  created  one
  36.          time and left  alone.  A database file (.dbs extension) and a
  37.          link response file (.lnk) are required.
  38.  
  39.  
  40.  
  41.  
  42.          THE DATABASE FILE
  43.  
  44.  
  45.          This file is required so that SMAKE can determine source file
  46.          dependencies.  For example, suppose  that  a  software system
  47.          consisted of three files:  MAIN.FOR, SUB1.FOR,  UTIL.FOR.  If
  48.          the system is  'up  to date', then the MAIN.OBJ is newer than
  49.          MAIN.FOR, SUB1.OBJ is newer than SUB1.FOR, and UTIL.OBJ is
  50.          newer than UTIL.FOR.  Furthermore, the MAIN.EXE file is newer
  51.          than all of the object files.
  52.  
  53.          So, if the  system  is  up to date,  and  the  user  modifies
  54.          SUB1.FOR, then SUB1.FOR  is  newer than SUB1.OBJ.   When  the
  55.          user issues the SMAKE command, then SMARTMAKE determines that
  56.          SUB1.FOR needs to  be  recompiled, and the system needs to be
  57.          relinked.
  58.  
  59.          The DATABASE file also contains  the  information  needed  to
  60.          initialize a compile,  compile, the linker name,  all  source
  61.          and object file  names,  and  the  information  to  reset the
  62.          system to 'normal' after the compile.
  63.  
  64.          The format for the DATABASE file is as follows:
  65.  
  66.          EXECUTABLE FILE NAME
  67.          LINKER NAME
  68.          BATCH FILE TO START UP ANY PATHS ETC
  69.          BATCH FILE TO RESET SYSTEM AFTER COMPILATION
  70.          SOURCE FILE 1
  71.          OBJECT FILE 1
  72.          COMPILER NAME
  73.          COMPILER FLAGS OR OPTIONS
  74.          SOURCE FILE 2
  75.          OBJECT FILE 2
  76.          COMPILER NAME
  77.          COMPILER FLAGS OR OPTIONS
  78.          ...
  79.          SOURCE FILE N
  80.          OBJECT FILE N
  81.          COMPILER NAME
  82.          COMPILER FLAGS OR OPTIONS
  83.          BLANK LINE
  84.  
  85.          For example, suppose you are using the Ryan-McFarland FORTRAN
  86.          compiler and the  Pocket  Soft   RTLINK   linker.   Then  the
  87.          contents of MAIN.DBS  which  compiles  the  MAIN   system  of
  88.          MAIN.FOR, SUB1.FOR and UTIL.FOR would be:
  89.  
  90.          RTLINK
  91.                                                 'blank, no setup
  92.                                                 'blank, no reset
  93.          MAIN.EXE
  94.          MAIN.FOR
  95.          MAIN.OBJ
  96.          RMFORT
  97.          /LINE
  98.          SUB1.FOR
  99.          SUB1.OBJ
  100.          RMFORT
  101.          /LINE
  102.          UTIL.FOR
  103.          UTIL.OBJ
  104.          RMFORT
  105.          /LINE
  106.                                                'blank line to end.
  107.  
  108.  
  109.          To update this  system, the user would issue the command from
  110.          the DOS command line:
  111.  
  112.                                  SMAKE MAIN
  113.  
  114.          SMARTMAKE would then  determine  if  any  files  need  to  be
  115.          recompiled, and if so, would recompile them and  relink.   If
  116.          for some reason  a  .obj  file  is newer than the executable,
  117.          then the system will be re-linked.   If  you  wish to force a
  118.          link, specify L on the command line when you SMAKE it.
  119.  
  120.                                   SMAKE MAIN L
  121.  
  122.  
  123.          In a similar vein, if you are concerned that some object file
  124.          integrity has been compromised, then you can issue  a command
  125.          to recompile all  of  the  files  and  relink the executable.
  126.          This is accomplished by issuing the command:
  127.  
  128.                               SMAKE MAIN C
  129.  
  130.          You might want to do this when  you  change  an include file,
  131.          since (as of  this  time)  includes  are  not   checked   for
  132.          modification since last compile.
  133.  
  134.  
  135.          THE LINK RESPONSE FILE
  136.          This file depends  solely  upon  the  linker that the user is
  137.          employing.  It has the format that is required by the linker.
  138.          Specifically, it is a file that  one  could  link '@' to form
  139.          the executable.  Again,  this file will vary from  linker  to
  140.          linker.  For example,  suppose  that  we are using the RTLINK
  141.          linker.  If so, then the link  response  file  for  the  MAIN
  142.          software system might be:
  143.  
  144.          VERBOSE
  145.          PRFILE OBJ
  146.          FILE MAIN
  147.          FILE SUB1
  148.          FILE UTIL
  149.          LIBRARY C:\RMFORT2\NP_LIB\RMFORT.LIB
  150.          LIBRARY SUP1
  151.          OUTPUT MAIN.EXE
  152.  
  153.          It just so happens that this link response file is compatible
  154.          with Phoenix's PLINK86 linker (with exception  of  the PRFILE
  155.          command, which Phoenix does not support).
  156.  
  157.  
  158.  
  159.          KNOWN DEFICIENCIES
  160.  
  161.          There is a known but repairable bug that might possibly
  162.          occur at 12:59-1:00  in  the  morning.    In  which case, one
  163.          might simply have to re-issue the SMAKE command, or touch the
  164.          source file involved.  It has  to  do with the algorithm used
  165.          to calculate which file is 'newer'.  The error  causes a file
  166.          not to be compiled when it should be.
  167.  
  168.          The SMARTMAKE system,  while  very useful under a broad range
  169.          of applications, is  not omniscient.   If  the  source  files
  170.          include files, then  if  the  include file is modified, SMAKE
  171.          has no way of knowing to recompile the source file.  There is
  172.          no easy way around this.  Even UNIX's MAKEFILE doesn't handle
  173.          this well.  The solution is not  good.   Each  of  the source
  174.          files would have  to  be  parsed  to determine  all  external
  175.          dependencies.  Since every  language  has  a different format
  176.          for including files, this is kind  of  difficult.   As a last
  177.          resort, if you are modifying include files, issue the
  178.          SMAKE DBSFILE C  command,  which  forces  all   files  to  be
  179.          recompiled.
  180.  
  181.          Again, if the   .DBS  file  is  changed,  (any  command  line
  182.          parameters to the compiler, ...) then all files should be
  183.          recompiled with the C option.
  184.  
  185.  
  186.                                  THE FINE PRINT
  187.  
  188.          I am not  responsible if this  program  causes  thermonuclear
  189.          reactions, acts of  God, or hard disk thrashing.   I'll  feel
  190.          real bad, but  don't  expect any money from me about it!  So,
  191.          use it at your own risk.
  192.  
  193.          Hey, this is shareware, so you  know the rules.  Use it for a
  194.          while.  If it doesn't make your programming tasks any easier,
  195.          dump it off of your disk and go about your business.   If you
  196.          find that you  just  can't get along without it, send me some
  197.          money.  I spent  a  long time  writing  this  program (mostly
  198.          FORTRAN, with the DOS file date routine in Assembler),  so  I
  199.          deserve some credit,  huh?   Mail me a 10 spot and we'll call
  200.          it even.  Hey, if 10 bucks is  too  much money, then you need
  201.          to charge more for YOUR services.  If you do register it,
  202.          I might even help you set up the .DBS file.  (You are on your
  203.          own with the .LNK fi